home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / unix / uucp103d / part05 < prev    next >
Encoding:
Internet Message Format  |  1990-02-04  |  58.2 KB

  1. Path: xanth!cs.odu.edu!Amiga-Request
  2. From: Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v90i049: uucp 1.03D - unix compatible uucp/mail/news system, Part05/16
  5. Message-ID: <11288@xanth.cs.odu.edu>
  6. Date: 4 Feb 90 02:32:48 GMT
  7. Sender: tadguy@cs.odu.edu
  8. Reply-To: overload!dillon (Matt Dillon)
  9. Lines: 2134
  10. Approved: tadguy@cs.odu.edu (Tad Guy)
  11. X-Mail-Submissions-To: Amiga@cs.odu.edu
  12.  
  13. Submitted-by: overload!dillon (Matt Dillon)
  14. Posting-number: Volume 90, Issue 049
  15. Archive-name: unix/uucp-1.03d/part05
  16.  
  17. #!/bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of archive 5 (of 16)."
  24. # Contents:  QuickSetup.DOC man/Compress man/DCron man/Getty
  25. #   man/NewsGroups man/dmail src/compress/unshar.c src/dmail/main.c
  26. #   src/dmail/sub.c
  27. # Wrapped by tadguy@xanth on Sat Feb  3 20:51:09 1990
  28. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  29. if test -f 'QuickSetup.DOC' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'QuickSetup.DOC'\"
  31. else
  32. echo shar: Extracting \"'QuickSetup.DOC'\" \(5830 characters\)
  33. sed "s/^X//" >'QuickSetup.DOC' <<'END_OF_FILE'
  34. X
  35. X                QUICKSETUP.DOC
  36. X
  37. X                Matthew Dillon
  38. X                891 Regal Rd.
  39. X                Berkeley, Ca. 94708
  40. X
  41. X                pacbell.PacBell.COM!sorinc!overload!dillon
  42. X
  43. X
  44. X            QUICKLY GETTING UUCP UP AND RUNNING
  45. X
  46. X
  47. X    THE FIRST FLOPPY IN THE DISTRIBUTION IS BOOTABLE and sets up a dummy
  48. X    system that accepts calls for Login = uucp and Password = uupc and
  49. X    nodes named uucp, test1, or test2.    To quickly test UUCP with a friend
  50. X    running the same distribution follow the directions immediately below.
  51. X    Note that these directions exist so you can quickly test UUCP with a
  52. X    copy of the boot floppy.  Once you know it works you MUST follow
  53. X    the procedure described in SlowSetup.DOC to create a real UUCP node.
  54. X
  55. X    Phrases in parenthesis refer to what the second person should do.
  56. X    Example, 1> dmail root@test2 (root@test1) asks person #1 to
  57. X    'dmail root@test2' and person #2 to 'dmail root@test1'
  58. X
  59. X            Person #1 (Person #2)
  60. X
  61. X    (1) Make a copy of both distribution diskettes and then put the
  62. X    originals away somewhere.  With a two floppy system you may
  63. X    simply use DiskCopy.  With a one floppy system you will need
  64. X    to copy things a directory at a time to your ram: disk and
  65. X    back (be very sure that you make an exact duplicate to prevent
  66. X    stupid mistakes).  If you are not using DiskCopy be sure to
  67. X    run the Install program on the copy to make it bootable.
  68. X
  69. X    The test procedure described below requires only a bootable
  70. X    copy of the FIRST distribution diskette.
  71. X
  72. X    You may want to copy your favorite editor to this floppy.  Remember
  73. X    that enough room must remain for queue and mail files, at least for
  74. X    initial testing.
  75. X
  76. X    You may also want to copy a terminal program to this floppy for
  77. X    troubleshooting.
  78. X
  79. X    The DME editor already exists on this disk.
  80. X
  81. X    (2) Reboot your computer with the first distribution diskette.
  82. X
  83. X    The boot sequence will leave two programs running in the
  84. X    background: DCron, and Getty.  Getty sits on the serial port
  85. X    waiting for connections while DCron is a timekeeping program
  86. X    which runs other programs at certain times based on a crontab
  87. X    file in S:.
  88. X
  89. X    (3) In the "lib/Config" file modify the NodeName entry to test1 (test2).
  90. X
  91. X    (4) In the "lib/L.Sys" file modify the telephone number to that
  92. X    of Person #1 (Person #2)
  93. X
  94. X    (5) Each of you email the other, 1> dmail root@test2 (root@test1)
  95. X    (Note that you are emailing to the OTHER guy's machine).
  96. X
  97. X    Leave a blank line after the headers and write a small note to
  98. X    the other person.  Shift-DEL deletes a line while F10 sends the
  99. X    message.  BTW, DMail runs the DME editor and this is what you
  100. X    are editing your email in.  You might want to refer to various
  101. X    documentation in the MAN directory of the SECOND distribution
  102. X    diskette.
  103. X
  104. X    (6) Check that the system has queued the files for transfer,
  105. X
  106. X    1> dir uuspool:
  107. X
  108. X    There should be one C. control file and two D. data files.  Each
  109. X    mail item queues three files so if you had, for example, sent
  110. X    two messages, there would be 6 files in UUSPOOL:
  111. X
  112. X
  113. X    (7) This assumes both of you have relatively standard modems
  114. X    connected to your systems.  If you do not have modems capable
  115. X    of a minimal AT instruction set you may have problems.
  116. X
  117. X    **NOTE** Most modems have dip-switch selectable Ignore-DTR.
  118. X    This should be disabled.  That is, dropping DTR should disconnect
  119. X    any connection.
  120. X
  121. X    THE MODEM MUST SUPPORT CARRIER DETECT.    Be sure that your
  122. X    serial cable passes carrier detect.
  123. X
  124. X    Current parameters set in lib/L.sys and s:startup-sequence assume
  125. X    at least a 1200 baud modem.
  126. X
  127. X    One of you should call the other.  For example, person #1 may
  128. X    call person #2 with the command "1> uucico -stest2", where 1>
  129. X    is the CLI prompt, and vise versa for person #2 "1> uucico -stest1".
  130. X
  131. X    UUCico will send the appropriate commands to your modem to call
  132. X    the other person using touch tone (ATDT) codes.  Refer to
  133. X    man/uucico on the second distribution disk for other options.
  134. X
  135. X    UUCico will then connect to the other system.  The Getty,
  136. X    run in the background on both systems, will accept the call
  137. X    and handle the login then run uucico on the second machine
  138. X    automatically.    The two uucico's should then transfer mail.
  139. X    This should take maybe a minute.
  140. X
  141. X    UUCico will then hangup, do further processing, then run
  142. X    another program in the background that deals with the queue
  143. X    files that were transfered by the remote machine (the same
  144. X    thing happens on the remote machine to deal with the queue
  145. X    files we transfered it).  After all disk activity finishes
  146. X    you each should have a message in your respective UUMAIL:
  147. X    directories in a file called 'root'.
  148. X
  149. X    1> Dir uumail:
  150. X    1> Type uumail:Root
  151. X
  152. X    (8) IF MAIL DID NOT GET TRANSFERED, and most likely you will have
  153. X    noticed UUCico giving up early, then something went wrong
  154. X    somewhere.
  155. X
  156. X    First determine on whos computer the problem is.  One of you
  157. X    use your term program to call the other person's computer.
  158. X    His Getty should answer with a stupid header line and a
  159. X    Login: prompt.    You should be able to login as 'test1' or
  160. X    'test2', password of 'uupc', and his computer ought to then
  161. X    run UUCico (you will see the characters 'Shere' appear after
  162. X    a short while and the system will appear to hang).  UUCico
  163. X    is a transfer protocol.
  164. X
  165. X    Each of you follow the above sequence on the other's computer.
  166. X    This verifies that the Getty program is working properly.
  167. X
  168. X    **NOTE**, some terminal programs will not work with Getty
  169. X    running in the background, you may have to BREAK the Getty
  170. X    program which in an unaltered startup-sequence will be
  171. X    CLI process #2.  DCron is CLI process #3.
  172. X
  173. X    Refer to Problems.DOC for more information.  Most problems at
  174. X    this point will be due to either screwing around with files
  175. X    beyond what I've asked you to modify or incorrectly configured
  176. X    or incompatible modems.
  177. X
  178. X                    ---
  179. X
  180. X    Please read SlowSetup.DOC for instructions on setting your
  181. X    system up for real.
  182. X
  183. END_OF_FILE
  184. if test 5830 -ne `wc -c <'QuickSetup.DOC'`; then
  185.     echo shar: \"'QuickSetup.DOC'\" unpacked with wrong size!
  186. fi
  187. # end of 'QuickSetup.DOC'
  188. fi
  189. if test -f 'man/Compress' -a "${1}" != "-c" ; then 
  190.   echo shar: Will not clobber existing file \"'man/Compress'\"
  191. else
  192. echo shar: Extracting \"'man/Compress'\" \(5367 characters\)
  193. sed "s/^X//" >'man/Compress' <<'END_OF_FILE'
  194. X
  195. X     NAME
  196. X      compress, uncompress, zcat - compress and expand data
  197. X
  198. X      14compress             - 14 bit version of compress,
  199. X                       takes less memory.
  200. X
  201. X      NOTE: 'uncompress' and 'zcat' are the exact same executable
  202. X      as 'compress', just renamed.  These 16 bit versions can also
  203. X      uncompress files compressed with 14compress
  204. X
  205. X     SYYNOPSIS
  206. X      compress [ -f ] [ -v ] [ -c ] [ -V ] [ -bits ] [ name ... ]
  207. X      uncompress [ -f ] [ -v ] [ -c ] [ -V ] [ name ... ]
  208. X      zcat [ -V ] [ name ... ]
  209. X
  210. X     DESCRIPTION
  211. X      * SPECIAL NOTE, for UUCP distributions which do not contain
  212. X        '14compress' but which do contain 'compress', the
  213. X        'compress' is actually the 14 bit version, not the 16
  214. X        bit version.
  215. X
  216. X      Compress reduces the size of the named files using adaptive
  217. X      Lempel-Ziv coding.  Whenever possible, each file is replaced
  218. X      by one with the extension .Z , while keeping the same
  219. X      ownership modes, access and modification times.  If no files
  220. X      are specified, the standard input is compressed to the
  221. X      standard output.  Compressed files can be restored to their
  222. X      original form using uncompress or zcat.
  223. X
  224. X      The -f option will force compression of name. This is useful
  225. X      for compressing an entire directory, even if some of the
  226. X      files do not actually shrink.  If -f is not given and
  227. X      compress is run in the foreground, the user is prompted as
  228. X      to whether an existing file should be overwritten.
  229. X
  230. X      The -c option makes compress/uncompress write to the
  231. X      standard output; no files are changed.  The nondestructive
  232. X      behavior of zcat is identical to that of uncompress -c.
  233. X
  234. X      Compress uses the modified Lempel-Ziv algorithm popularized
  235. X      in "A Technique for High Performance Data Compression",
  236. X      Terry A. Welch, IEEE Computer, vol. 17, no. 6 (June 1984),
  237. X      pp. 8-19.  Common substrings in the file are first replaced
  238. X      by 9-bit codes 257 and up.  When code 512 is reached, the
  239. X      algorithm switches to 10-bit codes and continues to use more
  240. X      bits until the limit specified by the -b flag is reached
  241. X      (default 16).  Bits must be between 9 and 16.  The default
  242. X      can be changed in the source to allow compress to be run on
  243. X      a smaller machine.
  244. X
  245. X      After the bits limit is attained, compress periodically
  246. X      checks the compression ratio.  If it is increasing, compress
  247. X      continues to use the existing code dictionary.  However, if
  248. X      the compression ratio decreases, compress discards the table
  249. X      of substrings and rebuilds it from scratch.  This allows the
  250. X      algorithm to adapt to the next "block" of the file.
  251. X
  252. X      Note that the -b flag is omitted for uncompress, since the
  253. X      bits parameter specified during compression is encoded
  254. X      within the output, along with a magic number to ensure that
  255. X      neither decompression of random data nor recompression of
  256. X      compressed data is attempted.
  257. X
  258. X      The amount of compression obtained depends on the size of
  259. X      the input, the number of bits per code, and the distribution
  260. X      of common substrings.  Typically, text such as source code
  261. X      or English is reduced by 50-60%.  Compression is generally
  262. X      much better than that achieved by Huffman coding (as used in
  263. X      pack), or adaptive Huffman coding (compact), and takes less
  264. X      time to compute.
  265. X
  266. X      Under the -v option, a message is printed yielding the
  267. X      percentage of reduction for each file compressed.
  268. X
  269. X      If the -V option is specified, the current version and
  270. X      compile options are printed on stderr.
  271. X
  272. X      Exit status is normally 0; if the last file is larger after
  273. X      (attempted) compression, the status is 2; if an error
  274. X      occurs, exit status is 1.
  275. X
  276. X     DIAGNOSTICS
  277. X      Usage: compress [-dfvcV] [-b maxbits] [file ...]
  278. X          Invalid options were specified on the command line.
  279. X      Missing maxbits
  280. X          Maxbits must follow -b.
  281. X      file: not in compressed format
  282. X          The file specified to uncompress has not been
  283. X          compressed.
  284. X      file: compressed with xx bits, can only handle yy bits
  285. X          File was compressed by a program that could deal
  286. X          with more bits than the compress code on this
  287. X          machine.  Recompress the file with smaller bits.
  288. X      file: already has .Z suffix -- no change
  289. X          The file is assumed to be already compressed.
  290. X          Rename the file and try again.
  291. X      file: filename too long to tack on .Z
  292. X          The file cannot be compressed because its name is
  293. X          longer than 12 characters.  Rename and try again.
  294. X          This message does not occur on BSD systems.
  295. X      file already exists; do you wish to overwrite (y or n)?
  296. X          Respond "y" if you want the output file to be
  297. X          replaced; "n" if not.
  298. X      uncompress: corrupt input
  299. X          A SIGSEGV violation was detected which usually means
  300. X          that the input file has been corrupted.
  301. X      Compression: xx.xx%
  302. X          Percentage of the input saved by compression.
  303. X          (Relevant only for -v.)
  304. X      -- not a regular file: unchanged
  305. X          When the input file is not a regular file, (e.g. a
  306. X          directory), it is left unaltered.
  307. X
  308. X      -- has xx other links: unchanged
  309. X          The input file has links; it is left unchanged.  See
  310. X          ln(1) for more information.
  311. X      -- file unchanged
  312. X          No savings is achieved by compression.  The input
  313. X          remains virgin.
  314. X
  315. X     BUGS
  316. X      Although compressed files are compatible between machines
  317. X      with large memory, -b12 should be used for file transfer to
  318. X      architectures with a small process data space (64KB or less,
  319. X      as exhibited by the DEC PDP series, the Intel 80286, etc.)
  320. X
  321. END_OF_FILE
  322. if test 5367 -ne `wc -c <'man/Compress'`; then
  323.     echo shar: \"'man/Compress'\" unpacked with wrong size!
  324. fi
  325. # end of 'man/Compress'
  326. fi
  327. if test -f 'man/DCron' -a "${1}" != "-c" ; then 
  328.   echo shar: Will not clobber existing file \"'man/DCron'\"
  329. else
  330. echo shar: Extracting \"'man/DCron'\" \(4580 characters\)
  331. sed "s/^X//" >'man/DCron' <<'END_OF_FILE'
  332. X
  333. X                DCRON.DOC
  334. X
  335. X                  UNIX-like CRON
  336. X
  337. X                  V2.00
  338. X                  7 August 1989
  339. X
  340. X                  Matthew Dillon
  341. X                  891 Regal Rd
  342. X                  Berkeley, Ca. 94708
  343. X
  344. X                 dillon@ucbvax.Berkeley.edu
  345. X                 ...!ucbvax!dillon
  346. X
  347. XDESCRIPTION:
  348. X
  349. X    Those not familar with the UNIX cron command probably do not need it.
  350. X
  351. X
  352. XINSTALLATION:
  353. X    the NULL: device must be mounted
  354. X
  355. X    an s:crontab file must exist (see instructions below)
  356. X
  357. X    1.3 RUN required so you can: run <nil: >nil: dcron <logfile>
  358. X
  359. X    copyadd l/null-handler into your l: and add the appropriate
  360. X    Mountlist entry to your devs:Mountlist (see included Mountlist
  361. X    file)
  362. X
  363. X    Create S:crontab with entries as you like.
  364. X
  365. XINSTRUCTIONS:
  366. X
  367. X    NOTE:   * All cron-commands are automatically RUN  in the background,
  368. X          you do not need to say 'run' in the command argument of the
  369. X          s:crontab file
  370. X
  371. X        * You do not have to redirect standard command output.  I.E.
  372. X          if you do a 'List' from cron, the output is sent to the
  373. X          cia.
  374. X
  375. X        * DCRON WORKS ONLY WITH 1.3, specifically, the 1.3 RUN command
  376. X          must be installed.
  377. X
  378. X        * DO NOT RUNBACK CRON!!!  Use: run <nil: >nil:
  379. X
  380. X
  381. X    Inspired by Rick Schaeffer's AmigaCron.  I decided to write this
  382. Xone from scratch.  The program is crontab file compatible with Rick's
  383. Xand the UNIX cron tab format with the same exceptions as Rick had.
  384. XSpecifically, the % char is not implemented and the day-of-week is
  385. Xranged 0-6 (Sun-Sat) rather than the UNIX 1-7 (Mon-Sun).
  386. X
  387. X
  388. X    The major purpose of this program, apart from yielding the functionality
  389. Xof cron, is the addition of major time optimizations.  The program loads
  390. Xs:crontab into memory and only reloads if the datestamp of the file has been
  391. Xmodified (checked every 60 seconds).  DCron also checks if the user has
  392. Xmodified the system time.
  393. X
  394. X    The result is that my cron takes virtually no CPU.
  395. X
  396. X    [run <nil: >nil:] DCron [-d] logfile
  397. X
  398. X    Using the 1.3 RUN command and redirecting both stdin and stdout to NIL:,
  399. X    you can safely close the CLI window that you ran DCron in.
  400. X
  401. X    The logfile is a required argument and logs all errors and status
  402. Xmessages.  Under normal conditions this file does not get very big.
  403. XCron does an open-append/write/close sequence every time it logs a message
  404. Xallowing you to cat, edit, or even remove the file with cron running.
  405. X(If you remove it, the next logged message will cause the file to be
  406. Xre-created).
  407. X
  408. X    The -d option, for debug, is used for debugging and logs additional
  409. Xinformation.  (may not be implemented in release)
  410. X
  411. X    The control file is S:CRONTAB and may contain one of three types of
  412. Xlines:    (1) A blank line, (2) A line beginning with a hash ``#'' which
  413. Xintroduces a comment, (3) A cron line of 5 or 6 fields:
  414. X
  415. X<min> <hour> <day> <month> <dayofweek>    [<command>]
  416. X
  417. X    Each field <min> to <dayofweek> can be either a single asterix ``*''
  418. Xwhich matches all times, or a comma delimited list of numbers or ranges
  419. Xwhich must be in numerical order.  Assume the control file is scanned
  420. Xevery minute.  On every minute, each field that matches the current
  421. Xtime, day, and day of week will be executed.
  422. X
  423. X    The <command> field is optional.  If no command is given the date is
  424. Xsimply logged to the logfile (as well as the cron line that caused it).
  425. XIf a command is given, it is a CLI command and is automatically RUN
  426. X(asynchronous from the cron task).  Standard in/out is NIL:  The cron line
  427. Xthat ran the command is logged.
  428. X
  429. X* * * * *   Date
  430. X
  431. X    Would execute the Date command every minute.  The output is ignored.
  432. X    I.E. useless.  Also, running something every minute wastes CPU.
  433. X
  434. X0-3,5,7,40-50 * * * *    Date
  435. X
  436. X    Would execute it at the hour, 1 past, 2 past, 3 past, 5 past, 7 past,
  437. X    40 41 42 ... and 50 past every hour.  Combinations can be used to
  438. X    yield more interesting results:
  439. X
  440. X0 0,12 * * 0    Date
  441. X
  442. X    Would run Date at midnight and 12 noon, but only on sunday.
  443. X
  444. X0 0 25 12 *    Echo >ram:x "Merry Cristmas"
  445. X
  446. X    Would execute the Echo command at midnight beginning christmas day and
  447. X    stick it in ram:x.
  448. X
  449. X* * * * 2-3 Date
  450. X
  451. X    Is useless ... execute the Date command every minute but only if the
  452. X    day is a tuesday or wednesday (i.e. 1440 times on tuesday, 1440
  453. X    times on wednesday, nothing for any other day).
  454. X
  455. X0 4 * * 1     shell >ram:backups -c "ChangeTaskPri -1;dobackups"
  456. X
  457. X    Would run a shell script to do my HD backup at 4:00 A.M. every Monday.
  458. X(I have the advantage of having two physical drives and can back one up
  459. Xto the other without user intervention).  This would also be useful to
  460. Xbackup something to a remote host if you are on a network.
  461. X
  462. X
  463. END_OF_FILE
  464. if test 4580 -ne `wc -c <'man/DCron'`; then
  465.     echo shar: \"'man/DCron'\" unpacked with wrong size!
  466. fi
  467. # end of 'man/DCron'
  468. fi
  469. if test -f 'man/Getty' -a "${1}" != "-c" ; then 
  470.   echo shar: Will not clobber existing file \"'man/Getty'\"
  471. else
  472. echo shar: Extracting \"'man/Getty'\" \(6005 characters\)
  473. sed "s/^X//" >'man/Getty' <<'END_OF_FILE'
  474. X
  475. XNAME
  476. X    Getty
  477. X
  478. XSYNOPSIS
  479. X    Getty -Sserialname -Uunit -Bbaud -Bbaud.. -Mc
  480. X          -m1 -r0 -h0 -c0 -xn -A -7 -0 [modem-cmds]
  481. X
  482. X    NOTE BUG:  You currently cannot run more than one Getty per
  483. X    *DEVICE NAME*, i.e. on more than one unit per device.
  484. X
  485. XDESCRIPTION
  486. X    Getty hangs on the specified serial port (serial.device unit 0 by
  487. X    default) waiting for connections via the connected modem.  Once
  488. X    a connection is accepted Getty adjusts to the proper baud rate
  489. X    using the CONNECT message, -B, -A options, then provides a
  490. X    Login: request to the caller.
  491. X
  492. X    NOTE: A CONNECT message from the modem with no baud rate specified
  493. X    will cause Getty to use the first baud rate in the -B list.  If
  494. X    the -A option is specified, Getty *always* uses the first baud
  495. X    rate in the -B list and never switches to any other baud rate.
  496. X
  497. X    If the caller sends a line-break Getty will switch to the next
  498. X    baud rate in the specified list.  During the initialization phase
  499. X    of the modem (before the first call and after a disconnect), Getty
  500. X    readjusts the baud rate to the first specified rate.
  501. X
  502. X    Getty disconnects any caller who cannot provide a legal Login and
  503. X    Password within 60 seconds.
  504. X
  505. X    Upon receiving a legal Login and and Password, verified via
  506. X    GETTY:PASSWD, Getty will execute the program specified in
  507. X    GETTY:PASSWD, usually UUCICO, and stay off the line until
  508. X    UUCICO returns.  When UUCICO returns, Getty will disconnect
  509. X    the caller and reset the modem, returning to its original state.
  510. X
  511. X    The file GETTY:Getty-Header contains a couple lines of text
  512. X    that are sent over the serial port before the Login: request.
  513. X    In it you normally have your machine type, name, etc...
  514. X
  515. X    Getty runs the specified program in the password entry adding
  516. X    the following arguments:
  517. X
  518. X        -Getty -DEVICE devicename -UNIT unitnumber
  519. X
  520. X    (uucico will recognize said arguments and not attempt to
  521. X     initialize / waitfor calls / hangup the modem itself)
  522. X
  523. X    Getty also recognizes when other amiga programs open the
  524. X    serial.device it is waiting on and will get off the line for
  525. X    the duration of the other program's connect (i.e. you can run
  526. X    terminal programs without having to BREAK Getty).
  527. X
  528. X    NOTE 1:     Getty can only get off the line when it is idle,
  529. X            waiting for carrier.  UUCP related programs will
  530. X            also use a separate locking mechanism to properly
  531. X            talk to Getty under other circumstances.
  532. X
  533. X    NOTE 2:     Getty will attempt a disconnect sequence when it
  534. X            reestablishes control after the other program
  535. X            closes the serial.device .    Getty checks the
  536. X            device count once a second.
  537. X
  538. XOPTIONS
  539. X    -Sserialname        Specify serial device, default "serial.device"
  540. X
  541. X    -Uunit            Specify unit number, default 0
  542. X
  543. X    -Bbaud            Specify up to 32 baud rates
  544. X
  545. X    -A            Specify modem will adjust to a single baud
  546. X                rate (locks the serial.device at the first
  547. X                baud rate in the -B list)
  548. X
  549. X    -7            Use SERF_7WIRE protocol while online,
  550. X                else uses no protocol while online.  If
  551. X                you are using a modem with speed conversion
  552. X                you need this option or you will most likely
  553. X                overflow the modem's buffer!
  554. X
  555. X    -Mc            Select Modem type,
  556. X
  557. X                c = m   Multimodem
  558. X                h   Hays
  559. X                d   Dumb  (no AT or +++ commands are
  560. X                       sent to the modem ever).
  561. X
  562. X    -mn            Set modem speaker level, default 0.
  563. X                (ATMn command)
  564. X
  565. X    -rn            Set modem to answer on the Nth ring
  566. X                (modem must support ATMn).  0 disables
  567. X                answer capability.    The default is to
  568. X                answer on the second ring.
  569. X
  570. X    -h0            Ignore CD (carrier detect).  If this option
  571. X                is specified a continuous carrier detect is
  572. X                assumed, causing Getty to request Login:'s
  573. X                over the line as soon as it receives a CONNECT
  574. X                message.
  575. X
  576. X                It is suggested you ONLY use this option
  577. X                when combined with -c0
  578. X
  579. X    -c0            Do NOT look for a CONNECT message from the
  580. X                modem... useful for dumb modems.
  581. X
  582. X    -d0            Normally Getty will disconnect by dropping
  583. X                DTR.  If this option is specified, Getty will
  584. X                use the less reliable +++ ATH0 sequence.
  585. X
  586. X    -xn            Set debugging level to n.  If specified
  587. X                debugging messages are sent to stdout instead
  588. X                of GETTY:LOGFILE
  589. X
  590. X                Note: to avoid GETTY:LOGFILE getting too
  591. X                large for busy systems, you can always add
  592. X                an entry to your crontab to delete it once
  593. X                a week (or whenever).
  594. X
  595. X    -0            Kill any already-running Getty for this
  596. X                serial port and unit.
  597. X
  598. X    modem-cmds        You may specify up to 16 specific commands
  599. X                to be sent to the modem whenever it is
  600. X                initialized (usually after a disconnect
  601. X                and on startup).  Each command will be
  602. X                sent to the modem with a CR on the end and
  603. X                a seconds delay afterwords.  Example:
  604. X
  605. X                ATS2=.
  606. X
  607. X                This is useful for provided specialized
  608. X                modems with the appropriate initialization
  609. X                strings.
  610. X
  611. XEXAMPLE
  612. X    ;   Run a Getty for a MultiModem
  613. X
  614. X    run >nil: <nil: Getty -Mm -A -B19200
  615. X
  616. X    ;   Run a Getty for a Hays Modem
  617. X
  618. X    run >nil: <nil: Getty -Mh -B1200 -B2400
  619. X
  620. X    ;   Modify options to a Getty already running in the background
  621. X
  622. X    Getty -m1        ; Set speaker on during dialing
  623. X    Getty -m0        ; speaker off at all times.
  624. X    Getty -0        ; kill background Getty
  625. X
  626. XEXAMPLE CRONTAB ENTRIES
  627. X    Assuming a getty has been run in the background from your
  628. X    startup sequence, the most common desire is to disable the
  629. X    modem speaker while you are asleep, and enable it at other
  630. X    times.    The following crontab entry will accomplish this:
  631. X
  632. X0    23    *    *    *    getty -m0
  633. X0    11    *    *    *    getty -m1
  634. X
  635. X    You can also kill (getty -0) or restart getty from your
  636. X    crontab, though the prefered method is to leave it running
  637. X    and only disable/enable the autoanswer (-r option) for those
  638. X    times you wish your modem to not accept calls.
  639. X
  640. X
  641. XFILES/REQUIRES
  642. X    GETTY:PASSWD
  643. X    GETTY:Getty-Header
  644. X    GETTY:LOGFILE
  645. X
  646. X    The NULL: handler must be mounted
  647. X    The UUSER: handler must be mounted if Passwd file contains
  648. X        *'d executable entries (don't confuse *'d executables
  649. X        with using '*' for the password field).
  650. X
  651. XREFERENCES
  652. X    Getty
  653. X    Passwd
  654. X
  655. END_OF_FILE
  656. if test 6005 -ne `wc -c <'man/Getty'`; then
  657.     echo shar: \"'man/Getty'\" unpacked with wrong size!
  658. fi
  659. # end of 'man/Getty'
  660. fi
  661. if test -f 'man/NewsGroups' -a "${1}" != "-c" ; then 
  662.   echo shar: Will not clobber existing file \"'man/NewsGroups'\"
  663. else
  664. echo shar: Extracting \"'man/NewsGroups'\" \(6833 characters\)
  665. sed "s/^X//" >'man/NewsGroups' <<'END_OF_FILE'
  666. Xnet.announce:
  667. Xalt.aquaria:
  668. Xalt.birthright:
  669. Xalt.california:
  670. Xalt.config:
  671. Xalt.cult-movies:
  672. Xalt.cyberpunk:
  673. Xalt.dev.null:
  674. Xalt.emusic:
  675. Xalt.flame:
  676. Xalt.general:
  677. Xalt.gourmand:
  678. Xalt.hypertext:
  679. Xalt.individualism:
  680. Xalt.recovery:
  681. Xalt.rhode_island:
  682. Xalt.rock-n-roll:
  683. Xalt.sca:
  684. Xalt.sex:
  685. Xalt.sources:
  686. Xalt.sources.amiga:
  687. Xarchive.comp.os.minix:
  688. Xarchive.comp.os.vms:
  689. Xarchive.comp.sources.unix:
  690. Xarchive.comp.sys.amiga:
  691. Xarchive.comp.sys.sun:
  692. Xarchive.comp.unix.wizards:
  693. Xcomp.ai:
  694. Xcomp.ai.digest:
  695. Xcomp.ai.edu:
  696. Xcomp.ai.neural-nets:
  697. Xcomp.ai.nlang-know-rep:
  698. Xcomp.ai.vision:
  699. Xcomp.arch:
  700. Xcomp.binaries.amiga:
  701. Xcomp.binaries.apple2:
  702. Xcomp.binaries.atari.st:
  703. Xcomp.binaries.ibm.pc:
  704. Xcomp.binaries.ibm.pc.d:
  705. Xcomp.binaries.mac:
  706. Xcomp.bugs.2bsd:
  707. Xcomp.bugs.4bsd:
  708. Xcomp.bugs.4bsd.ucb-fixes:
  709. Xcomp.bugs.misc:
  710. Xcomp.bugs.sys5:
  711. Xcomp.cog-eng:
  712. Xcomp.compilers:
  713. Xcomp.databases:
  714. Xcomp.dcom.lans:
  715. Xcomp.dcom.modems:
  716. Xcomp.dcom.telecom:
  717. Xcomp.doc:
  718. Xcomp.doc.techreports:
  719. Xcomp.editors:
  720. Xcomp.edu:
  721. Xcomp.edu.composition:
  722. Xcomp.emacs:
  723. Xcomp.fonts:
  724. Xcomp.graphics:
  725. Xcomp.graphics.digest:
  726. Xcomp.hypercube:
  727. Xcomp.ivideodisc:
  728. Xcomp.lang.ada:
  729. Xcomp.lang.apl:
  730. Xcomp.lang.asm370:
  731. Xcomp.lang.c:
  732. Xcomp.lang.c++:
  733. Xcomp.lang.forth:
  734. Xcomp.lang.fortran:
  735. Xcomp.lang.icon:
  736. Xcomp.lang.lisp:
  737. Xcomp.lang.lisp.franz:
  738. Xcomp.lang.lisp.x:
  739. Xcomp.lang.misc:
  740. Xcomp.lang.modula2:
  741. Xcomp.lang.pascal:
  742. Xcomp.lang.postscript:
  743. Xcomp.lang.prolog:
  744. Xcomp.lang.rexx:
  745. Xcomp.lang.scheme:
  746. Xcomp.lang.scheme.c:
  747. Xcomp.lang.smalltalk:
  748. Xcomp.laser-printers:
  749. Xcomp.lsi:
  750. Xcomp.lsi.cad:
  751. Xcomp.mail.elm:
  752. Xcomp.mail.headers:
  753. Xcomp.mail.maps:
  754. Xcomp.mail.mh:
  755. Xcomp.mail.misc:
  756. Xcomp.mail.sendmail:
  757. Xcomp.mail.uucp:
  758. Xcomp.misc:
  759. Xcomp.music:
  760. Xcomp.newprod:
  761. Xcomp.org.decus:
  762. Xcomp.org.fidonet:
  763. Xcomp.org.usenix:
  764. Xcomp.org.usrgroup:
  765. Xcomp.os.cpm:
  766. Xcomp.os.eunice:
  767. Xcomp.os.fidonet:
  768. Xcomp.os.minix:
  769. Xcomp.os.misc:
  770. Xcomp.os.os9:
  771. Xcomp.os.research:
  772. Xcomp.os.rsts:
  773. Xcomp.os.v:
  774. Xcomp.os.vms:
  775. Xcomp.os.xinu:
  776. Xcomp.parallel:
  777. Xcomp.periphs:
  778. Xcomp.periphs.printers:
  779. Xcomp.protocols.appletalk:
  780. Xcomp.protocols.ibm:
  781. Xcomp.protocols.iso:
  782. Xcomp.protocols.iso.x400:
  783. Xcomp.protocols.iso.x400.gateway:
  784. Xcomp.protocols.kermit:
  785. Xcomp.protocols.misc:
  786. Xcomp.protocols.tcp-ip:
  787. Xcomp.protocols.tcp-ip.domains:
  788. Xcomp.protocols.tcp-ip.ibmpc:
  789. Xcomp.risks:
  790. Xcomp.simulation:
  791. Xcomp.society:
  792. Xcomp.society.futures:
  793. Xcomp.society.women:
  794. Xcomp.software-eng:
  795. Xcomp.sources.amiga:
  796. Xcomp.sources.atari.st:
  797. Xcomp.sources.bugs:
  798. Xcomp.sources.d:
  799. Xcomp.sources.games:
  800. Xcomp.sources.games.bugs:
  801. Xcomp.sources.mac:
  802. Xcomp.sources.misc:
  803. Xcomp.sources.unix:
  804. Xcomp.sources.wanted:
  805. Xcomp.std.c:
  806. Xcomp.std.internat:
  807. Xcomp.std.misc:
  808. Xcomp.std.mumps:
  809. Xcomp.std.unix:
  810. Xcomp.sys.amiga:
  811. Xcomp.sys.amiga.tech:
  812. Xcomp.sys.apollo:
  813. Xcomp.sys.apple:
  814. Xcomp.sys.atari.8bit:
  815. Xcomp.sys.atari.st:
  816. Xcomp.sys.att:
  817. Xcomp.sys.cbm:
  818. Xcomp.sys.celerity:
  819. Xcomp.sys.dec:
  820. Xcomp.sys.dec.micro:
  821. Xcomp.sys.encore:
  822. Xcomp.sys.handhelds:
  823. Xcomp.sys.hp:
  824. Xcomp.sys.ibm.pc:
  825. Xcomp.sys.ibm.pc.digest:
  826. Xcomp.sys.ibm.pc.net:
  827. Xcomp.sys.ibm.pc.rt:
  828. Xcomp.sys.intel:
  829. Xcomp.sys.intel.ipsc310:
  830. Xcomp.sys.laptops:
  831. Xcomp.sys.m6809:
  832. Xcomp.sys.m68k:
  833. Xcomp.sys.m68k.pc:
  834. Xcomp.sys.mac:
  835. Xcomp.sys.mac.digest:
  836. Xcomp.sys.mac.hypercard:
  837. Xcomp.sys.mac.programmer:
  838. Xcomp.sys.masscomp:
  839. Xcomp.sys.misc:
  840. Xcomp.sys.nsc.32k:
  841. Xcomp.sys.proteon:
  842. Xcomp.sys.pyramid:
  843. Xcomp.sys.ridge:
  844. Xcomp.sys.sequent:
  845. Xcomp.sys.sgi:
  846. Xcomp.sys.sun:
  847. Xcomp.sys.super:
  848. Xcomp.sys.tahoe:
  849. Xcomp.sys.tandy:
  850. Xcomp.sys.ti:
  851. Xcomp.sys.transputer:
  852. Xcomp.sys.workstations:
  853. Xcomp.sys.xerox:
  854. Xcomp.sys.zenith:
  855. Xcomp.sys.zenith.z100:
  856. Xcomp.terminals:
  857. Xcomp.terminals.bitgraph:
  858. Xcomp.text:
  859. Xcomp.text.desktop:
  860. Xcomp.theory:
  861. Xcomp.theory.cell-automata:
  862. Xcomp.theory.dynamic-sys:
  863. Xcomp.theory.info-retrieval:
  864. Xcomp.theory.self-org-sys:
  865. Xcomp.unix:
  866. Xcomp.unix.aux:
  867. Xcomp.unix.microport:
  868. Xcomp.unix.questions:
  869. Xcomp.unix.ultrix:
  870. Xcomp.unix.wizards:
  871. Xcomp.unix.xenix:
  872. Xcomp.windows.misc:
  873. Xcomp.windows.news:
  874. Xcomp.windows.x:
  875. Xgnu.announce:
  876. Xgnu.chess:
  877. Xgnu.config:
  878. Xgnu.emacs:
  879. Xgnu.emacs.bug:
  880. Xgnu.emacs.lisp.manual:
  881. Xgnu.emacs.vms:
  882. Xgnu.g++:
  883. Xgnu.g++.bug:
  884. Xgnu.gcc:
  885. Xgnu.gcc.bug:
  886. Xgnu.gdb.bug:
  887. Xmisc.consumers:
  888. Xmisc.consumers.house:
  889. Xmisc.forsale:
  890. Xmisc.handicap:
  891. Xmisc.headlines:
  892. Xmisc.invest:
  893. Xmisc.jobs:
  894. Xmisc.jobs.misc:
  895. Xmisc.jobs.offered:
  896. Xmisc.jobs.resumes:
  897. Xmisc.kids:
  898. Xmisc.legal:
  899. Xmisc.misc:
  900. Xmisc.psi:
  901. Xmisc.security:
  902. Xmisc.taxes:
  903. Xmisc.wanted:
  904. Xnews.admin:
  905. Xnews.announce.conferences:
  906. Xnews.announce.important:
  907. Xnews.announce.newusers:
  908. Xnews.config:
  909. Xnews.groups:
  910. Xnews.lists:
  911. Xnews.misc:
  912. Xnews.newsites:
  913. Xnews.software.b:
  914. Xnews.software.nntp:
  915. Xnews.software.notes:
  916. Xnews.stargate:
  917. Xnews.sysadmin:
  918. Xnj.events:
  919. Xnj.forsale:
  920. Xnj.general:
  921. Xnj.wanted:
  922. Xny.forsale:
  923. Xny.general:
  924. Xny.nysernet.maps:
  925. Xny.nysernet.nysertech:
  926. Xny.wanted:
  927. Xra.slug:
  928. Xrec.arts.anime:
  929. Xrec.arts.books:
  930. Xrec.arts.comics:
  931. Xrec.arts.drwho:
  932. Xrec.arts.int-fiction:
  933. Xrec.arts.movies:
  934. Xrec.arts.movies.reviews:
  935. Xrec.arts.poems:
  936. Xrec.arts.sf-lovers:
  937. Xrec.arts.startrek:
  938. Xrec.arts.tv:
  939. Xrec.arts.tv.soaps:
  940. Xrec.arts.wobegon:
  941. Xrec.audio:
  942. Xrec.autos:
  943. Xrec.autos.sport:
  944. Xrec.autos.tech:
  945. Xrec.aviation:
  946. Xrec.bicycles:
  947. Xrec.birds:
  948. Xrec.boats:
  949. Xrec.equestrian:
  950. Xrec.folk-dancing:
  951. Xrec.food.cooking:
  952. Xrec.food.drink:
  953. Xrec.food.recipes:
  954. Xrec.food.veg:
  955. Xrec.games.board:
  956. Xrec.games.bridge:
  957. Xrec.games.chess:
  958. Xrec.games.empire:
  959. Xrec.games.frp:
  960. Xrec.games.go:
  961. Xrec.games.hack:
  962. Xrec.games.misc:
  963. Xrec.games.moria:
  964. Xrec.games.pbm:
  965. Xrec.games.programmer:
  966. Xrec.games.rogue:
  967. Xrec.games.trivia:
  968. Xrec.games.video:
  969. Xrec.gardens:
  970. Xrec.guns:
  971. Xrec.ham-radio:
  972. Xrec.ham-radio.packet:
  973. Xrec.humor:
  974. Xrec.humor.d:
  975. Xrec.humor.funny:
  976. Xrec.humor.spc:
  977. Xrec.mag:
  978. Xrec.mag.otherrealms:
  979. Xrec.misc:
  980. Xrec.models.rc:
  981. Xrec.motorcycles:
  982. Xrec.music.beatles:
  983. Xrec.music.bluenote:
  984. Xrec.music.classical:
  985. Xrec.music.folk:
  986. Xrec.music.gaffa:
  987. Xrec.music.gdead:
  988. Xrec.music.makers:
  989. Xrec.music.misc:
  990. Xrec.music.synth:
  991. Xrec.nude:
  992. Xrec.pets:
  993. Xrec.photo:
  994. Xrec.puzzles:
  995. Xrec.railroad:
  996. Xrec.scuba:
  997. Xrec.skiing:
  998. Xrec.skydiving:
  999. Xrec.sport:
  1000. Xrec.sport.baseball:
  1001. Xrec.sport.basketball:
  1002. Xrec.sport.football:
  1003. Xrec.sport.hockey:
  1004. Xrec.sport.misc:
  1005. Xrec.travel:
  1006. Xrec.video:
  1007. Xrec.woodworking:
  1008. Xsci.astro:
  1009. Xsci.bio:
  1010. Xsci.crypt:
  1011. Xsci.electronics:
  1012. Xsci.lang:
  1013. Xsci.lang.japan:
  1014. Xsci.logic:
  1015. Xsci.math:
  1016. Xsci.math.stat:
  1017. Xsci.math.symbolic:
  1018. Xsci.med:
  1019. Xsci.med.aids:
  1020. Xsci.misc:
  1021. Xsci.nanotech:
  1022. Xsci.philosophy.meta:
  1023. Xsci.philosophy.tech:
  1024. Xsci.physics:
  1025. Xsci.psychology:
  1026. Xsci.research:
  1027. Xsci.space:
  1028. Xsci.space.shuttle:
  1029. Xsoc.college:
  1030. Xsoc.culture.african:
  1031. Xsoc.culture.arabic:
  1032. Xsoc.culture.celtic:
  1033. Xsoc.culture.china:
  1034. Xsoc.culture.esperanto:
  1035. Xsoc.culture.greek:
  1036. Xsoc.culture.indian:
  1037. Xsoc.culture.japan:
  1038. Xsoc.culture.jewish:
  1039. Xsoc.culture.misc:
  1040. Xsoc.human-nets:
  1041. Xsoc.men:
  1042. Xsoc.misc:
  1043. Xsoc.motss:
  1044. Xsoc.net-people:
  1045. Xsoc.politics:
  1046. Xsoc.politics.arms-d:
  1047. Xsoc.religion.christian:
  1048. Xsoc.roots:
  1049. Xsoc.singles:
  1050. Xsoc.women:
  1051. Xtalk.abortion:
  1052. Xtalk.bizarre:
  1053. Xtalk.origins:
  1054. Xtalk.philosophy.misc:
  1055. Xtalk.politics:
  1056. Xtalk.politics.arms-d:
  1057. Xtalk.politics.mideast:
  1058. Xtalk.politics.misc:
  1059. Xtalk.politics.soviet:
  1060. Xtalk.politics.theory:
  1061. Xtalk.religion:
  1062. Xtalk.religion.christian:
  1063. Xtalk.religion.misc:
  1064. Xtalk.religion.newage:
  1065. Xtalk.rumors:
  1066. Xunix-pc.bugs:
  1067. Xunix-pc.general:
  1068. Xunix-pc.sources:
  1069. Xunix-pc.uucp:
  1070. Xalt.test:
  1071. Xcontrol:
  1072. Xgnu.test:
  1073. Xjunk:
  1074. Xmisc.test:
  1075. Xnj.test:
  1076. Xny.test:
  1077. Xpa.test:
  1078. Xunix-pc.test:
  1079. END_OF_FILE
  1080. if test 6833 -ne `wc -c <'man/NewsGroups'`; then
  1081.     echo shar: \"'man/NewsGroups'\" unpacked with wrong size!
  1082. fi
  1083. # end of 'man/NewsGroups'
  1084. fi
  1085. if test -f 'man/dmail' -a "${1}" != "-c" ; then 
  1086.   echo shar: Will not clobber existing file \"'man/dmail'\"
  1087. else
  1088. echo shar: Extracting \"'man/dmail'\" \(5912 characters\)
  1089. sed "s/^X//" >'man/dmail' <<'END_OF_FILE'
  1090. X
  1091. XNAME
  1092. X    DMail
  1093. X
  1094. XSYNOPSIS
  1095. X    DMail        go into mail shell if mail pending
  1096. X    DMail -O    go into mail shell whether you have mail or not
  1097. X    DMail path    mail somebody (go directly to mail editor)
  1098. X    DMail -f file    use a file other than your default mail box
  1099. X
  1100. X    There are other options.  To get a complete list of options
  1101. X    enter 'DMail -O' at a CLI prompt, then at the mail prompt
  1102. X    enter the 'help' command.
  1103. X
  1104. X    The file MAN:dmail.help must exist for dmail's online help
  1105. X    to work!  This file exists in the boot floppy's man directory.
  1106. X
  1107. XDESCRIPTION
  1108. X
  1109. X    DMail is an interactive mail editor that allows you to
  1110. X    view and respond to messages in your mail box as well
  1111. X    as generate new messages from scratch.    DMail has a huge
  1112. X    number of commands and options ('set' variables) that cannot
  1113. X    be described in a manual entry like this so I leave those to
  1114. X    the online help capability.
  1115. X
  1116. X    The basic dmail commands are (and these may be abbreviated):
  1117. X
  1118. X        type  [msgno]    type a message
  1119. X        reply [msgno]    reply to a message
  1120. X        Reply [msgno]    reply to a message and include original text
  1121. X        mail  path        send new mail to somebody
  1122. X        d      [msgno]    delete a message
  1123. X        dt            delete current msg and type next one
  1124. X        db            delete current msg and type previous one
  1125. X        list        list available messages
  1126. X
  1127. X    These are only a few commands out of many.  Commands like
  1128. X    mail and reply bring up an interactive editor (default is DME
  1129. X    but you should be able to use your favorite editor... just
  1130. X    change the defaults in UULIB:Config).
  1131. X
  1132. X    When sending and replying to email, what you see from the
  1133. X    editor is pretty much what you get.  If you quit out of the
  1134. X    editor without saving the email is aborted.  If you save and
  1135. X    quit from the editor DMail will scan the message and figure
  1136. X    out who to send it to by extracting addresses out of the
  1137. X    To:, Cc:, and Bcc: fields.  DMail then runs Sendmail to
  1138. X    actually send the message (which may wind up queueing it
  1139. X    via UUCP to somewhere else).
  1140. X
  1141. X    You list the primary recipients of the message in the To:
  1142. X    field, separated by commas.  you may continue an address
  1143. X    list like this:
  1144. X
  1145. X        To:     blah, blah, blah, blah, blah,
  1146. X            blah, blah, blah, blah, blah,
  1147. X        Cc:
  1148. X
  1149. X    The Cc: field lists carbon-copy recipients of the message...
  1150. X    people you want to see the message but for which the message
  1151. X    is not primarily meant for.  This can be left blank or
  1152. X    deleted.
  1153. X
  1154. X    The Bcc: field lists blind-carbon-copy recipients of the
  1155. X    message.  Specifically, the message gets sent to these
  1156. X    people but the Bcc: field itself is NOT propogated, so nobody
  1157. X    but you knows that the message was also sent to these
  1158. X    people.
  1159. X
  1160. X    Every message should have a Subject: field, usually a one
  1161. X    liner that describes the subject of the message.  When replying
  1162. X    to a message you usually keep the original message's Subject:
  1163. X    line and prepend an 'Re:' to it... normally you do NOT allow
  1164. X    Re:'s to build up.  I.E. Re: Re: Re: <original subj> is not
  1165. X    considered proper.
  1166. X
  1167. X    When using the upper case Reply that includes the original
  1168. X    text of the message, please prune out as much as you can to
  1169. X    decrease redundant bandwidth.  The original most likely has
  1170. X    a copy of the original message anyway and the idea is to
  1171. X    simply provide a soft reminder to jog the originator's memory.
  1172. X
  1173. X    A BLANK LINE ALWAYS SEPARATES THE HEADER LIST FROM THE MESSAGE
  1174. X    BODY!!!
  1175. X
  1176. XADDRESSES
  1177. X
  1178. X    DMail attempts to pick the proper return path when you reply
  1179. X    to a message and place that path into the To: field for you.
  1180. X
  1181. X    DMail does not always get it right.  Sometimes it is not
  1182. X    possible to get it right.  Generally, bang (!) only paths
  1183. X    are safe.  A bang path lists the machines the message to
  1184. X    reach through with the last field being the user on the
  1185. X    destination machine.  For example:
  1186. X
  1187. X        To: sorinc!pacbell!nobody
  1188. X
  1189. X    Assuming I talk UUCP to sorinc directly my message will be
  1190. X    sent first to the machine sorinc, then the machine pacbell,
  1191. X    and then placed in 'nobody's mailbox on pacbell.
  1192. X
  1193. X    When at all possible finding a fully domained machine in a
  1194. X    path makes email all the more reliable.  For example,
  1195. X
  1196. X        To: pacbell.pacbell.com!sorinc!overload!dillon
  1197. X
  1198. X    This is the path to my amiga.  Note that the first element
  1199. X    in the path is a fully domain'd machine (an address with
  1200. X    dots in it).  If your Amiga talks to a machine that understands
  1201. X    domains (say you connect to a university machine), and assuming
  1202. X    you set your 'DefaultNode' entry in UULIB:Config to this
  1203. X    machine, a message addressed as above will get to me.
  1204. X
  1205. X            BADLY FORMED ADDRESSES
  1206. X
  1207. X    Unfortunately, USENET and INTERNET addresses do not mix well.
  1208. X    On the INTERNET and address like this:
  1209. X
  1210. X        a!b!user@foo.com    maps to    foo.com!a!b!user
  1211. X
  1212. X    Whereas the same address in USENET format:
  1213. X
  1214. X        a!b!user@foo.com    maps to    a!b!foo.com!user
  1215. X
  1216. X    Your best bet is to look at the 'Received:' fields in the
  1217. X    mail header (the HEADER command in DMail, but read the online
  1218. X    help for the HEADER command before using it).  These fields
  1219. X    tell you exactly which machines the message got routed
  1220. X    through and the order in which it was routed.  Try your
  1221. X    best to construct a bang (!) only path to the destination.
  1222. X
  1223. X    Sending mail directly to an arbitrary address usually doesn't
  1224. X    work.  For example, mail to fnf@fishpond.UUCP (Fred Fish)
  1225. X    will fail utterly.  On the otherhand, using the path:
  1226. X
  1227. X        <adjacent-big-machine>!cs.utexas.edu!asuvax!mcdphx!estinc!fnf
  1228. X
  1229. X    will work assuming <adjacent-big-machine> understands domains.
  1230. X    P.S. if your DefaultNode entry in your UULIB:Config file is
  1231. X    set properly and assuming the later about your connection to the
  1232. X    outside world, you can just email directly through an arbitrary
  1233. X    domained name:
  1234. X
  1235. X        cs.utexas.edu!asuvax!mcdphx!estinc!fnf
  1236. X
  1237. X    Of course, if you have UUCP setup in a small network between
  1238. X    a few friends and none of you have access to a major USENET
  1239. X    node then you cannot email outside your little group.
  1240. X
  1241. X    Refer to the Domains manual page for information on using
  1242. X    the UULIB:Domain file to simplify addressing.
  1243. X
  1244. END_OF_FILE
  1245. if test 5912 -ne `wc -c <'man/dmail'`; then
  1246.     echo shar: \"'man/dmail'\" unpacked with wrong size!
  1247. fi
  1248. # end of 'man/dmail'
  1249. fi
  1250. if test -f 'src/compress/unshar.c' -a "${1}" != "-c" ; then 
  1251.   echo shar: Will not clobber existing file \"'src/compress/unshar.c'\"
  1252. else
  1253. echo shar: Extracting \"'src/compress/unshar.c'\" \(6648 characters\)
  1254. sed "s/^X//" >'src/compress/unshar.c' <<'END_OF_FILE'
  1255. X/*
  1256. X *    unshar    -- undo a shell archive file
  1257. X *    (C) Copyright June 4 1987 by Craig Norborg
  1258. X *    Permission given to use this code in any form as long as it is
  1259. X *    not sold or marketed in any form without the written permission
  1260. X *    of its author.    Removal of this copyright notice is expressly
  1261. X *    forbidden as well as any alteration of it.
  1262. X */
  1263. X/*
  1264. X *    Here is a small unshar program written to be as portable as possible.
  1265. X *    It was written under Aztec C on an Amiga and tested on a VAX 11/780,
  1266. X *    pdp11/70 and a Sequent Balance 21000.  Any bug reports or enhancements
  1267. X *    should be reported to the author.  Some further enhancements may
  1268. X *    include the correct handling of sub-directories and the handling of
  1269. X *    btoa/atob type shars.  If you find a type of shar that this code
  1270. X *    does not work on, please send it to me, doc@j.cc.purdue.edu.
  1271. X */
  1272. X
  1273. X#include <stdio.h>
  1274. X#include <ctype.h>
  1275. X#include "/version.h"
  1276. X
  1277. XIDENT(".00");
  1278. X
  1279. X#ifdef unix
  1280. X#include <sys/file.h>
  1281. X#endif unix
  1282. X#ifdef AMIGA
  1283. X#define F_OK    0
  1284. X#endif AMIGA
  1285. X
  1286. X#define BUFSIZE 512        /* Max length of an input line */
  1287. X#define STRLEN    25        /* Max length of a file name or delimiter */
  1288. X#define CAT    "cat"           /* The name of the 'cat' program */
  1289. X#define SED    "sed"           /* The name of the 'sed' program */
  1290. X#define TEST    "if test"       /* Leader for test types */
  1291. X
  1292. X/*
  1293. X * This is a small routine that given the beginning of a quoted, backslashed
  1294. X * or just plain string, will return it in a given buffer.
  1295. X */
  1296. Xvoid
  1297. Xcopystring(source, dest)
  1298. Xchar *source, *dest;
  1299. X{
  1300. X    register int i = 0;
  1301. X    char c;
  1302. X
  1303. X    if ('\'' == *source || '\"' == *source) {/* Is it a quoted string? */
  1304. X        c = *source;
  1305. X        while (c != *++source)
  1306. X            dest[i++] = *source;
  1307. X        source++;
  1308. X    } else if ('\\' == *source) {                   /* Is it a backslashed string? */
  1309. X        while (!isspace(*++source))
  1310. X            dest[i++] = *source;
  1311. X    } else {                                /* Just a string */
  1312. X        while (!isspace(*source)) {
  1313. X            dest[i++] = *source;
  1314. X            source++;
  1315. X        }
  1316. X    }
  1317. X    dest[i] = '\0';
  1318. X}
  1319. X
  1320. Xvoid
  1321. Xwordcount(buf, filename, wc)
  1322. Xchar *buf, *filename;
  1323. Xint wc;
  1324. X{
  1325. X    if (wc != atoi(buf)) {
  1326. X        (void) printf("Error unsharing %s (wc should have been %d, but was %d)\n", filename, atoi(buf), wc);
  1327. X    }
  1328. X}
  1329. X
  1330. Xint
  1331. Xcheckfile(string)
  1332. Xchar *string;
  1333. X{
  1334. X    char filename[BUFSIZE];
  1335. X
  1336. X    while (0 != isspace(*string))
  1337. X        string++;
  1338. X
  1339. X    copystring(string, filename);
  1340. X    if (0 == access(filename, F_OK))
  1341. X        return 1;
  1342. X
  1343. X    return 0;
  1344. X}
  1345. X
  1346. X/*
  1347. X * This is a small routine that given a 'cat' or 'sed' string, will pull out
  1348. X * the end of file string and the file name
  1349. X */
  1350. Xvoid
  1351. Xgetendfile(line, end, file)
  1352. Xchar   *line,            /* The 'sed' or 'cat' string */
  1353. X       *end,            /* Place to store the end of file marker */
  1354. X       *file;            /* Place for the filename */
  1355. X{
  1356. X    char   *tmp, *strrchr();
  1357. X
  1358. X    /*
  1359. X     * This section of code finds the end of file string.  It assumes
  1360. X     * that the eof string is the string of characters immediately
  1361. X     * following the last '<' and that it has either a '\' preceding it
  1362. X     * or is surrounded by single quotes.
  1363. X     */
  1364. X    tmp = (char *) strrchr(line, '<');       /* Find the last '<' on the
  1365. X                                             * line */
  1366. X    while (isspace(*++tmp))
  1367. X        ;    /* Do nothing */
  1368. X    copystring(tmp, end);
  1369. X
  1370. X    /*
  1371. X     * This section of code finds the name of the file.  It assumes that
  1372. X     * the name of the file is the string immediately following the last
  1373. X     * '>' in the line
  1374. X     */
  1375. X    tmp = (char *) strrchr(line, '>');
  1376. X    while (isspace(*++tmp))
  1377. X        ;    /* Do Nothing */
  1378. X    copystring(tmp, file);
  1379. X
  1380. X#ifdef DEBUG
  1381. X    (void) printf("EOF = %s, FILE = %s\n", end, file);
  1382. X#endif DEBUG
  1383. X}
  1384. X
  1385. Xint
  1386. Xmain(argc, argv)
  1387. Xint    argc;
  1388. Xchar  **argv;
  1389. X{
  1390. X    FILE   *fp, *dfp, *fopen();     /* input file pointer and dest file
  1391. X                     * pointer */
  1392. X    char    buf[BUFSIZE],        /* line buffer */
  1393. X        prefix[STRLEN],     /* SED leader if any */
  1394. X        endstring[STRLEN],    /* EOF marker */
  1395. X        filename[STRLEN];    /* file name */
  1396. X    int    infile = 0,            /* var to tell if we're in the middle of a
  1397. X                                 * file or not */
  1398. X        wc = 0,             /* variable to keep a word count */
  1399. X            fileexists = 0;     /* does the file exist? */
  1400. X
  1401. X    if (1 == argc) {        /* check usage */
  1402. X        (void) printf("usage: unshar <file>");
  1403. X    }
  1404. X    if (NULL == (fp = fopen(argv[1], "r"))) {
  1405. X        (void) printf("Error opening input file\n");
  1406. X        exit(1);
  1407. X    }
  1408. X    while (NULL != fgets(buf, BUFSIZE, fp)) {       /* while there are lines
  1409. X                             * to get */
  1410. X#ifdef DEBUG
  1411. X        puts(buf);
  1412. X#endif DEBUG
  1413. X
  1414. X        if (0 == infile) {      /* if we are not in the middle of a
  1415. X                     * file */
  1416. X            if ('#' == buf[0])      /* comment? */
  1417. X                continue;
  1418. X
  1419. X            /* Is this a CAT type shar? */
  1420. X            if (0 == strncmp(buf, CAT, strlen(CAT))) {
  1421. X                prefix[0] = '\0';
  1422. X                getendfile(buf, endstring, filename);
  1423. X                if (fileexists != 0) {
  1424. X                    fprintf(stderr, "File exists (%s), skipping\n", filename);
  1425. X                    fileexists = 0;
  1426. X                    continue;
  1427. X                }
  1428. X                if (NULL == (dfp = fopen(filename, "w"))) {
  1429. X                    (void) printf("Error opening output file %s\n", filename);
  1430. X                    exit(1);
  1431. X                }
  1432. X                (void) printf("Extracting %s ... ", filename);
  1433. X                (void) fflush(stdout);
  1434. X                infile = 1;
  1435. X                wc = 0;
  1436. X                continue;
  1437. X            }
  1438. X            /* Is it a SED type shar? */
  1439. X            if (0 == strncmp(buf, SED, strlen(SED))) {
  1440. X                register int i = 0, j = 0;
  1441. X
  1442. X                while ('^' != buf[i++])
  1443. X                    ;
  1444. X                while ('/' != buf[i]) {
  1445. X                    prefix[j++] = buf[i++];
  1446. X                }
  1447. X                prefix[j] = '\0';
  1448. X                getendfile(&buf[i], endstring, filename);
  1449. X                if (fileexists != 0) {
  1450. X                    fprintf(stderr, "File exists (%s), skipping\n", filename);
  1451. X                    fileexists = 0;
  1452. X                    continue;
  1453. X                }
  1454. X                if (NULL == (dfp = fopen(filename, "w"))) {
  1455. X                    (void) printf("Error opening output file %s\n", filename);
  1456. X                    exit(1);
  1457. X                }
  1458. X                (void) printf("Extracting %s ... ", filename);
  1459. X                (void) fflush(stdout);
  1460. X                infile = 1;
  1461. X                wc = 0;
  1462. X                continue;
  1463. X            }
  1464. X            /* Do we want to do a test of sorts on a file? */
  1465. X            if (0 == strncmp(buf, TEST, strlen(TEST))) {
  1466. X                register int i = 0;
  1467. X
  1468. X                while(!isdigit(buf[i]) && '-' != buf[i] && NULL != buf[i])
  1469. X                    i++;
  1470. X
  1471. X                if (0 != isdigit(buf[i])) {
  1472. X                    wordcount(&buf[i], filename, wc);
  1473. X                }
  1474. X
  1475. X                if ('f' == buf[++i]) {
  1476. X                    fileexists = checkfile(&buf[++i]);
  1477. X                }
  1478. X                continue;
  1479. X            }
  1480. X        } else {    /* We are in the middle of a file */
  1481. X
  1482. X            /* Are we at the end of this one? */
  1483. X            if (0 == strncmp(buf, endstring, strlen(endstring))) {
  1484. X                (void) printf("Done\n");
  1485. X                (void) fclose(dfp);
  1486. X                infile = 0;
  1487. X                continue;
  1488. X            }
  1489. X            /* No, then does it have a prefix? */
  1490. X            if ('\0' == prefix[0]) {
  1491. X                fputs(buf, dfp);
  1492. X                wc = wc + strlen(buf);
  1493. X            } else {
  1494. X
  1495. X                /*
  1496. X                 * If it does have a prefix, is there one on
  1497. X                 * this line?
  1498. X                 */
  1499. X                if (0 != strncmp(buf, prefix, strlen(prefix))) {
  1500. X                    fputs(buf, dfp);
  1501. X                } else {
  1502. X                    fputs(&buf[strlen(prefix)], dfp);
  1503. X                    wc = wc + strlen(buf) - strlen(prefix);
  1504. X                }
  1505. X            }
  1506. X        }
  1507. X    }
  1508. X    (void) printf("All Done!\n");
  1509. X    (void) fclose(fp);
  1510. X}
  1511. END_OF_FILE
  1512. if test 6648 -ne `wc -c <'src/compress/unshar.c'`; then
  1513.     echo shar: \"'src/compress/unshar.c'\" unpacked with wrong size!
  1514. fi
  1515. # end of 'src/compress/unshar.c'
  1516. fi
  1517. if test -f 'src/dmail/main.c' -a "${1}" != "-c" ; then 
  1518.   echo shar: Will not clobber existing file \"'src/dmail/main.c'\"
  1519. else
  1520. echo shar: Extracting \"'src/dmail/main.c'\" \(6011 characters\)
  1521. sed "s/^X//" >'src/dmail/main.c' <<'END_OF_FILE'
  1522. X
  1523. X/*
  1524. X * MAIN.C
  1525. X *
  1526. X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
  1527. X *
  1528. X *  Global Routines:    MAIN()
  1529. X *            INIT()
  1530. X *            SIG_HANDLE()
  1531. X *
  1532. X *  Static Routines:    none.
  1533. X */
  1534. X
  1535. X#include <pwd.h>
  1536. X#include <stdio.h>
  1537. X#include <signal.h>
  1538. X#include <sys/types.h>
  1539. X#include <sys/stat.h>
  1540. X#include <config.h>
  1541. X#include "/version.h"
  1542. X
  1543. X#include "dmail.h"
  1544. X
  1545. XIDENT(".00");
  1546. Xchar *dillon_cpr = DCOPYRIGHT;
  1547. X
  1548. X#define MAILHOME "UUMAIL:"
  1549. X#define MBOX     "UUMAIL:mbox"
  1550. X#define ALT_MBOX "UUMAIL:.mbox"
  1551. X#define MAILRC     "UULIB:.dmailrc"
  1552. X#define VISUAL     "dme"
  1553. X
  1554. Xvoid  init();
  1555. X
  1556. Xvoid
  1557. Xmain(argc, argv)
  1558. Xchar *argv[];
  1559. X{
  1560. X    int i, next, Retry;
  1561. X    int fop = 0, oop = 0;
  1562. X    int rcload = 1;
  1563. X    int options = 1;
  1564. X    int no_mail_overide = 0;
  1565. X    int nc = 0;
  1566. X    static int nameslist[128];
  1567. X    char *rcname;
  1568. X
  1569. X    if (push_base())
  1570. X    done (1);
  1571. X
  1572. X    init();
  1573. X    rcname = malloc (strlen(home_dir) + strlen(MAILRC) + 2);
  1574. X#ifdef AMIGA
  1575. X    rcname[0] = 0;
  1576. X#else
  1577. X    strcpy (rcname, home_dir);
  1578. X    strcat (rcname, "/");
  1579. X#endif
  1580. X    strcat (rcname, MAILRC);
  1581. X    for (i = 1; i < argc; ++i) {
  1582. X    next = 0;
  1583. X    if ((*argv[i] == '-') && options) {
  1584. X        if (*(argv[i] + 1) == '\0') {
  1585. X        options = 0;
  1586. X        continue;
  1587. X        }
  1588. X        while (*++argv[i]) {
  1589. X        switch (*argv[i]) {
  1590. X        case 'S':
  1591. X            lmessage_overide = 1;
  1592. X            break;
  1593. X        case 'O':
  1594. X            no_mail_overide = 1;
  1595. X            break;
  1596. X        case 'l':
  1597. X            rcload  = 1;
  1598. X            if (i + 1 < argc  &&  *argv[i + 1] != '-') {
  1599. X            xfree (rcname);
  1600. X            oop = 1;
  1601. X            ++i;
  1602. X            ++next;
  1603. X            rcname = malloc (strlen (argv[i]) + 1);
  1604. X            strcpy (rcname, argv[i]);
  1605. X            }
  1606. X            break;
  1607. X        case 'L':
  1608. X            rcload = 0;
  1609. X            break;
  1610. X        case 'D':
  1611. X            XDebug = 1;
  1612. X            break;
  1613. X        case 'F':
  1614. X            if (++i < argc) {
  1615. X            add_extra (argv[i]);
  1616. X            } else {
  1617. X            puts (" -F Requires Field argument");
  1618. X            exit (1);
  1619. X            }
  1620. X            ++next;
  1621. X            break;
  1622. X        case 'v':
  1623. X            set_var (LEVEL_SET, "verbose", "");
  1624. X            break;
  1625. X        case 'o':
  1626. X            xfree (output_file);
  1627. X            if (i + 1 < argc  &&  *argv[i + 1] != '-') {
  1628. X            oop = 1;
  1629. X            ++i;
  1630. X            ++next;
  1631. X            output_file = malloc (strlen (argv[i]) + 1);
  1632. X            strcpy (output_file, argv[i]);
  1633. X            } else {
  1634. X            oop = -1;
  1635. X            output_file = malloc (strlen(home_dir) +
  1636. X                strlen(ALT_MBOX) + 2);
  1637. X#ifdef AMIGA
  1638. X            strcpy (output_file, ALT_MBOX);
  1639. X#else
  1640. X            sprintf (output_file, "%s/%s", home_dir, ALT_MBOX);
  1641. X#endif
  1642. X            }
  1643. X            break;
  1644. X        case 'f':
  1645. X            if (i + 1 < argc  &&  *argv[i + 1] != '-') {
  1646. X            fop = 1;
  1647. X            ++i;
  1648. X            ++next;
  1649. X            mail_file = realloc (mail_file, strlen (argv[i]) + 1);
  1650. X            strcpy (mail_file, argv[i]);
  1651. X            } else {
  1652. X            fop = -1;
  1653. X            mail_file = realloc (mail_file,
  1654. X                strlen(home_dir) + strlen(MBOX) + 2);
  1655. X#ifdef AMIGA
  1656. X            strcpy (mail_file, MBOX);
  1657. X#else
  1658. X            sprintf (mail_file, "%s/%s", home_dir, MBOX);
  1659. X#endif
  1660. X            }
  1661. X            break;
  1662. X        default:
  1663. X            puts ("dmail: Bad argument");
  1664. X            puts ("dmail -O      then 'help' for help.");
  1665. X            done (1);
  1666. X        }
  1667. X        if (next)
  1668. X            break;
  1669. X        }
  1670. X    } else {
  1671. X        No_load_mail = 1;
  1672. X        nameslist[nc++] = i;
  1673. X    }
  1674. X    }
  1675. X    if (oop == -1  &&  fop == -1) {
  1676. X    mail_file = realloc (mail_file, strlen(output_file) + 1);
  1677. X    strcpy (mail_file, output_file);
  1678. X    }
  1679. Xends:
  1680. X    initial_load_mail();
  1681. X    m_select (Nulav, M_RESET);
  1682. X    Current = indexof (1);
  1683. X    if (nc)
  1684. X    set_var (LEVEL_SET, "comlinemail", "");
  1685. X    if (rcload) {
  1686. X    ac = 2;
  1687. X    av[1] = rcname;
  1688. X    do_source(rcname, 1);
  1689. X    }
  1690. X    if (nc) {
  1691. X    av[0] = "mail";
  1692. X    for (i = 0; i < nc; ++i)
  1693. X        av[i + 1] = argv[nameslist[i]];
  1694. X    ac = nc + 1;
  1695. X    do_reply ("", R_MAIL);
  1696. X    done (0);
  1697. X    }
  1698. X    if (Entries + no_mail_overide == 0) {
  1699. X    printf ("\nNO MAIL for %s\n\n", user_name);
  1700. X    return;
  1701. X    }
  1702. X    printf ("\nRF %-20s   WF %-20s\n", mail_file, output_file);
  1703. X    do {
  1704. X    Retry = 20;
  1705. X    pop_base();
  1706. Xloop:
  1707. X    if (push_base()) {
  1708. X        pop_base();
  1709. X        if (XDebug)
  1710. X        printf ("TOP LEVEL INTR, Level: %d\n", Longstack);
  1711. X        if (--Retry == 0)
  1712. X        done (1);
  1713. X        puts ("");
  1714. X        goto loop;
  1715. X    }
  1716. X    check_new_mail();
  1717. X    } while (do_command() > 0);
  1718. X    return;
  1719. X}
  1720. X
  1721. Xvoid
  1722. Xinit()
  1723. X{
  1724. X    char *str;
  1725. X    struct passwd *passwd;
  1726. X    extern int sig_handle();
  1727. X
  1728. X    Entry = (struct ENTRY *)malloc (sizeof(*Entry));
  1729. X    Entry->status = Entry->no = Entry->fpos = 0;
  1730. X    passwd = getpwuid(getuid());
  1731. X    if (passwd == NULL) {
  1732. X    printf("DMail, unable to get passwd entry for uid %d\n", getuid());
  1733. X    exit(1);
  1734. X    }
  1735. X    user_name    = malloc (strlen(passwd->pw_name) + 1);
  1736. X    home_dir    = malloc (strlen(passwd->pw_dir) + 1);
  1737. X    visual    = malloc (sizeof(VISUAL));
  1738. X    strcpy  (visual     , VISUAL);
  1739. X    strcpy  (user_name, passwd->pw_name);
  1740. X    strcpy  (home_dir , passwd->pw_dir);
  1741. X#ifdef AMIGA
  1742. X    if (str = FindConfig(HOME))
  1743. X    strcpy ((home_dir = realloc (home_dir, strlen(str) + 1)), str);
  1744. X    if (str = FindConfig(USERNAME))
  1745. X    strcpy ((user_name = realloc (user_name, strlen(str) + 1)), str);
  1746. X    if (str = FindConfig(EDITOR))
  1747. X    strcpy ((visual = realloc (visual, strlen(str) + 1)), str);
  1748. X#else
  1749. X    if ((str = getenv ("HOME")) != NULL)
  1750. X    strcpy ((home_dir = realloc (home_dir, strlen(str) + 1)), str);
  1751. X    if ((str = getenv ("USER")) != NULL)
  1752. X    strcpy ((user_name = realloc (user_name, strlen(str) + 1)), str);
  1753. X    if ((str = getenv ("VISUAL")) != NULL)
  1754. X    strcpy ((visual = realloc (visual, strlen(str) + 1)), str);
  1755. X#endif
  1756. X    mail_file    = malloc (strlen(MAILHOME) + strlen(user_name) + 1);
  1757. X    sprintf (mail_file  , "%s%s", MAILHOME, user_name);
  1758. X    output_file = malloc (strlen(home_dir) + 2 + sizeof(MBOX));
  1759. X#ifdef AMIGA
  1760. X    strcpy(output_file, MBOX);
  1761. X#else
  1762. X    sprintf (output_file, "%s/%s", home_dir, MBOX);
  1763. X#endif
  1764. X    fix_globals();
  1765. X#ifdef UNIX
  1766. X    signal (SIGHUP, sig_handle);
  1767. X    signal (SIGINT, sig_handle);
  1768. X    signal (SIGPIPE, SIG_IGN);
  1769. X#endif
  1770. X#ifdef AMIGA
  1771. X    signal (SIGINT, sig_handle);
  1772. X#endif
  1773. X}
  1774. X
  1775. Xsig_handle()
  1776. X{
  1777. X#ifdef UNIX
  1778. X    int mask = sigblock (0);
  1779. X
  1780. X    sigsetmask (mask & ~((1 << SIGHUP) | (1 << SIGINT)));
  1781. X#endif
  1782. X#ifdef AMIGA
  1783. X    signal (SIGINT, sig_handle);    /*  reload signal */
  1784. X#endif
  1785. X    if (Longstack  &&  !Breakstack)
  1786. X    longjmp (env[Longstack], 1);
  1787. X    return(0);
  1788. X}
  1789. X
  1790. Xget_inode(file)
  1791. Xchar *file;
  1792. X{
  1793. X    struct stat stats;
  1794. X
  1795. X    if (stat (file, &stats) < 0)
  1796. X    return (-1);
  1797. X    return (stats.st_ino);
  1798. X}
  1799. X
  1800. END_OF_FILE
  1801. if test 6011 -ne `wc -c <'src/dmail/main.c'`; then
  1802.     echo shar: \"'src/dmail/main.c'\" unpacked with wrong size!
  1803. fi
  1804. # end of 'src/dmail/main.c'
  1805. fi
  1806. if test -f 'src/dmail/sub.c' -a "${1}" != "-c" ; then 
  1807.   echo shar: Will not clobber existing file \"'src/dmail/sub.c'\"
  1808. else
  1809. echo shar: Extracting \"'src/dmail/sub.c'\" \(4899 characters\)
  1810. sed "s/^X//" >'src/dmail/sub.c' <<'END_OF_FILE'
  1811. X
  1812. X/*
  1813. X * SUB.C
  1814. X *
  1815. X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
  1816. X *
  1817. X *  Global Routines:    INDEXOF()
  1818. X *            SIG()
  1819. X *            POSITION_CURRENT()
  1820. X *            SKIP_TO_DATE()
  1821. X *            GET_FIELD()
  1822. X *            COMPILE_FIELD()
  1823. X *            ISFROM()
  1824. X *            XSTRNCMP()
  1825. X *            NEXT_WORD()
  1826. X *            DONE()
  1827. X *
  1828. X */
  1829. X
  1830. X#include <signal.h>
  1831. X#include <stdio.h>
  1832. X#include "dmail.h"
  1833. X
  1834. X#ifdef UNIX
  1835. Xextern FILE *popen();
  1836. X#endif
  1837. X
  1838. X#define SENDMAIL "sendmail"
  1839. X
  1840. Xxfree(ptr)
  1841. Xchar *ptr;
  1842. X{
  1843. X    static char *sptr;
  1844. X
  1845. X    if (sptr)
  1846. X    free (sptr);
  1847. X    sptr = ptr;
  1848. X    return (1);
  1849. X}
  1850. X
  1851. X
  1852. Xindexof(num)
  1853. Xregister int num;
  1854. X{
  1855. X    register int i, last;
  1856. X
  1857. X    if (num < 1)
  1858. X    num = -1;
  1859. X    for (last = -1, i = 0; i < Entries; ++i) {
  1860. X    if (Entry[i].no) {
  1861. X        last = i;
  1862. X        if (Entry[i].no == num)
  1863. X        return (i);
  1864. X    }
  1865. X    }
  1866. X    if (num == -1  &&  last >= 0)
  1867. X    return (last);
  1868. X    return (-1);
  1869. X}
  1870. X
  1871. Xvoid
  1872. Xnull()
  1873. X{
  1874. X}
  1875. X
  1876. X
  1877. Xposition_current()
  1878. X{
  1879. X    int pos;
  1880. X
  1881. X    if (!m_fi)
  1882. X    return(0);
  1883. X    if (Current >= 0) {
  1884. X    pos = Entry[Current].fpos;
  1885. X    if (fseek (m_fi, pos, 0) < 0 || ftell(m_fi) != pos)
  1886. X        puts ("ERROR: Cannot position file to message");
  1887. X    } else {
  1888. X    fseek (m_fi, 0, 0);
  1889. X    }
  1890. X}
  1891. X
  1892. X
  1893. Xskip_to_data(fi)
  1894. XFILE *fi;
  1895. X{
  1896. X    static char buf[MAXFIELDSIZE];
  1897. X
  1898. X    while (fgets (buf, MAXFIELDSIZE, fi) != NULL) {
  1899. X    if (*buf == '\n')
  1900. X        return (1);
  1901. X    }
  1902. X    return (-1);
  1903. X}
  1904. X
  1905. X
  1906. Xchar *
  1907. Xget_field(str)
  1908. Xchar *str;
  1909. X{
  1910. X    int i, entry = Current;
  1911. X    int len = strlen(str);
  1912. X
  1913. X    if (Current < 0)
  1914. X    return("");
  1915. X    i = get_extra (str);
  1916. X    if (i >= 0)
  1917. X    return (Entry[entry].fields[i]);
  1918. X    if (m_fi == NULL)
  1919. X    return ("");
  1920. X    fseek (m_fi, Entry[entry].fpos, 0);
  1921. X    while (fgets (Buf, MAXFIELDSIZE, m_fi) != NULL) {
  1922. X    if (isfrom (Buf))
  1923. X        break;
  1924. X    if (strncmp (Buf, str, len) == 0) {
  1925. X        Buf[strlen(Buf) - 1] = '\0';
  1926. X        compile_field(Buf, m_fi);
  1927. X        return (next_word (Buf));
  1928. X    }
  1929. X    }
  1930. X    return ("");
  1931. X}
  1932. X
  1933. X
  1934. Xcompile_field(buf, fi)
  1935. Xchar *buf;
  1936. XFILE *fi;
  1937. X{
  1938. X    int len, acc, pos;
  1939. X
  1940. X    acc = 0;
  1941. X    buf += strlen (buf) + 1;
  1942. X    pos = ftell (fi);
  1943. X    while (fgets (buf, MAXFIELDSIZE - acc, fi) != NULL) {
  1944. X    if (*buf == ' ' || *buf == 9) {
  1945. X        *(buf - 1) = '\n';
  1946. X        len = strlen (buf) - 1;
  1947. X        *(buf + len) = '\0';
  1948. X        buf += len;
  1949. X        acc += len + 2;
  1950. X        if (acc > MAXFIELDSIZE - 10) {
  1951. X        printf ("Warning: Field size beyond %d bytes\n", MAXFIELDSIZE);
  1952. X        sleep (2);
  1953. X        return (1);
  1954. X        }
  1955. X    } else {
  1956. X        *buf = '\0';
  1957. X        fseek (fi, pos, 0);
  1958. X        return (1);
  1959. X    }
  1960. X    pos = ftell (fi);
  1961. X    }
  1962. X    fseek (fi, pos, 0);
  1963. X}
  1964. X
  1965. X
  1966. Xisfrom(str)
  1967. Xregister char *str;
  1968. X{
  1969. X    static char from[] = {"From "};
  1970. X    register int i = 0;
  1971. X
  1972. X    while (i < 5) {
  1973. X    if (*str++ != from[i++])
  1974. X        return (0);
  1975. X    }
  1976. X    return (1);
  1977. X}
  1978. X
  1979. X
  1980. Xxstrncmp (src, dest, len)
  1981. Xregister char *src, *dest;
  1982. Xregister int len;
  1983. X{
  1984. X    while (--len >= 0) {
  1985. X    if ((*src & 0x1f) != (*dest & 0x1f)) {
  1986. X        if ((*src & 0x1f) < (*dest & 0x1f))
  1987. X        return (-1);
  1988. X        return (1);
  1989. X    }
  1990. X    ++src; ++dest;
  1991. X    }
  1992. X    return (0);
  1993. X}
  1994. X
  1995. X
  1996. X
  1997. Xchar *
  1998. Xnext_word(str)
  1999. Xregister char *str;
  2000. X{
  2001. X    while (*str  &&  *str != ' '  && *str != 9)
  2002. X    ++str;
  2003. X    while (*str  &&  (*str == ' ' || *str == 9))
  2004. X    ++str;
  2005. X    return (str);
  2006. X}
  2007. X
  2008. Xvoid
  2009. Xdone(n)
  2010. X{
  2011. X    char scr[64];
  2012. X
  2013. X    push_break();
  2014. X    sprintf (scr, "tmp:dmail%d", getpid());
  2015. X    unlink (scr);
  2016. X    sprintf (scr, "tmp:dmt%d", getpid());
  2017. X    unlink (scr);
  2018. X    unlink ("#");
  2019. X    exit (n);
  2020. X}
  2021. X
  2022. Xvoid
  2023. Xfix_globals()
  2024. X{
  2025. X    char *ptr;
  2026. X
  2027. X    push_break();
  2028. X    S_page = (ptr = get_var (LEVEL_SET, "page")) ?
  2029. X        ((*ptr) ? atoi (ptr) : 24) : -1;
  2030. X    if (S_page > 0  && (S_page -= 4) < 0)
  2031. X    S_page = 1;
  2032. X
  2033. X    S_sendmail = (ptr = get_var (LEVEL_SET, "sendmail")) ? ptr : SENDMAIL;
  2034. X    S_novibreak= (ptr = get_var (LEVEL_SET, "vibreak")) ? 0 : 1;
  2035. X    S_verbose  = (ptr = get_var (LEVEL_SET, "verbose")) ? 1 : 0;
  2036. X    S_ask      = (ptr = get_var (LEVEL_SET, "ask")) ? 1 : 0;
  2037. X    S_archive  = (ptr = get_var (LEVEL_SET, "archive")) ? 1 : 0;
  2038. X    if (S_archive && *ptr == '\0')
  2039. X    S_archive = 0;
  2040. X    pop_break();
  2041. X}
  2042. X
  2043. X
  2044. X_pager(str, nl)
  2045. Xchar *str;
  2046. Xint nl;
  2047. X{
  2048. X    static int count;
  2049. X    static FILE *fi;
  2050. X    static char buf[1024];
  2051. X#ifdef UNIX
  2052. X    char *ptr;
  2053. X#endif
  2054. X
  2055. X    if (str == 0) {
  2056. X    switch (S_page) {
  2057. X    case -1:
  2058. X        count = 0;
  2059. X        return (1);
  2060. X    case 0:
  2061. X#ifdef UNIX
  2062. X        ptr = get_var (LEVEL_SET, "page");
  2063. X        fi = popen (ptr, "w");
  2064. X        if (fi == NULL) {
  2065. X        count = 0;
  2066. X        printf ("CANNOT RUN PAGER PROGRAM: %s\n", ptr);
  2067. X        } else {
  2068. X        count = -1;
  2069. X        }
  2070. X#else
  2071. X        count = 0;
  2072. X        fi = stdout;
  2073. X#endif
  2074. X        return (1);
  2075. X    default:
  2076. X        count = 0;
  2077. X        return (1);
  2078. X    }
  2079. X    }
  2080. X    if ((long)str == -1) {
  2081. X#ifdef UNIX
  2082. X    if (fi != NULL) {
  2083. X        pclose (fi);
  2084. X        fi = NULL;
  2085. X    }
  2086. X#else
  2087. X    fi = NULL;
  2088. X#endif
  2089. X    return (1);
  2090. X    }
  2091. X    if (count < 0) {
  2092. X    fputs (str, fi);
  2093. X    while (nl--)
  2094. X        fputs ("\n", fi);
  2095. X    } else {
  2096. X    fputs (str, stdout);
  2097. X    while (nl--) {
  2098. X        fputs ("\n", stdout);
  2099. X        ++count;
  2100. X    }
  2101. X#ifdef AMIGA
  2102. X    fflush(stdout);
  2103. X#endif
  2104. X    while (*str) {
  2105. X        if (*str++ == '\n')
  2106. X        ++count;
  2107. X    }
  2108. X    if (S_page > 0  &&  S_page <= count) {
  2109. X        count = 0;
  2110. X        puts ("\n-- more --");
  2111. X        gets(buf);
  2112. X    }
  2113. X    }
  2114. X}
  2115. X
  2116. END_OF_FILE
  2117. if test 4899 -ne `wc -c <'src/dmail/sub.c'`; then
  2118.     echo shar: \"'src/dmail/sub.c'\" unpacked with wrong size!
  2119. fi
  2120. # end of 'src/dmail/sub.c'
  2121. fi
  2122. echo shar: End of archive 5 \(of 16\).
  2123. cp /dev/null ark5isdone
  2124. MISSING=""
  2125. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; do
  2126.     if test ! -f ark${I}isdone ; then
  2127.     MISSING="${MISSING} ${I}"
  2128.     fi
  2129. done
  2130. if test "${MISSING}" = "" ; then
  2131.     echo You have unpacked all 16 archives.
  2132.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2133. else
  2134.     echo You still need to unpack the following archives:
  2135.     echo "        " ${MISSING}
  2136. fi
  2137. ##  End of shell archive.
  2138. exit 0
  2139. -- 
  2140. Submissions to comp.sources.amiga and comp.binaries.amiga should be sent to:
  2141.     amiga@cs.odu.edu    
  2142. or    amiga@xanth.cs.odu.edu    ( obsolescent mailers may need this address )
  2143. or    ...!uunet!xanth!amiga    ( very obsolescent mailers need this address )
  2144.  
  2145. Comments, questions, and suggestions should be addressed to ``amiga-request''
  2146. (please only use ``amiga'' for actual submissions) at the above addresses.
  2147.